<html>
<script>
// http://davidshariff.com/js-quiz/

/*debugger;
var foo =function foo(){
    console.log(foo === foo);};

foo();

Number("1")-1=== 0; true

(true+false)>2+true; false

function aaa(){return{
        test:1};}
alert(typeof aaa()); // object, since { test:1 } is an object


function bar(){return foo;
    foo =10;function foo(){}var foo ='11';}
alert(typeof bar()); 

debugger;
var x =3;

var foo ={
    x:2,
    baz:{
        	x:1,
        	bar:function(){
        		return this.x;
        	}
        }
    };
var go = foo.baz.bar;

alert(go());
alert(foo.baz.bar());
[]+[]+'foo'.split('');

debugger;
var a = [];

var b = a + [];

var c = b +'foo'.split('A');
var c = b +'foo'.split('A');// still foo

一个数字参数构造函数，指定数组长度（由于数组长度可以动态调整，作用并不大），创建指定长度的数组
length = 5, every element is undefined
var a2=new Array(5);
var a = new Array(5);

console.log(a.toString()); // ,,,,

String('Hello')==='Hello'; true

"Hello" ==='Hello'; true 

debugger;
var x =0;

function foo(){
    x++;
    this.x = x;
    return foo;
}
var bar = new new foo;
console.log(bar.x); // undefined
"This is a string" instanceof String; false

new String("This is a string") instanceof String; true
"This is a string" instanceof String; false

instanceof("T")
VM1929:2 Uncaught SyntaxError: Unexpected token instanceof
    at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
    at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
    at Object.InjectedScript.evaluate (<anonymous>:694:21)InjectedScript._evaluateOn @ VM1679:905InjectedScript._evaluateAndWrap @ VM1679:838InjectedScript.evaluate @ VM1679:694
typeof("T")
"string"


debugger;
var bar =1,
    foo = {};

foo:{
    	bar:2;
    	as: console.log("hello"); // can even execute code, after that it is discarded
    	baz: ++bar;
    };

foo.baz + foo.bar + bar; // NaN
debugger;
var myArr =['foo','bar','baz'];
myArr[2];
console.log('2' in myArr); // true
console.log('1' in myArr); // true
console.log('3' in myArr); // false
console.log('0' in myArr); // true

var arr =[];
arr[0]='a';
arr[1]='b';
arr.foo ='c';
alert(arr.length); 

10>9>8===true; // false
(10>9>8)===true;// false
var a = 10;
var b = 9;
var c = a>b; // true
var d = 8;
var e = c>d; // false*/
debugger;
function foo(a, b){
    arguments[1]=2;
    alert(b);}
foo(1);


</script>
</html>